package mobi.greenplate.client.domain;

import java.io.Serializable;

public class Location implements Serializable {

    private static final long serialVersionUID = 1L;
    private Long id;
    private String locationName;
    private Address address;
    private User owner;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public User getOwner() {
        return owner;
    }

    public void setOwner(User owner) {
        this.owner = owner;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Location other = (Location) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if ((this.locationName == null) ? (other.locationName != null) : !this.locationName.equals(other.locationName)) {
            return false;
        }
        if (this.address != other.address && (this.address == null || !this.address.equals(other.address))) {
            return false;
        }
        if (this.owner != other.owner && (this.owner == null || !this.owner.equals(other.owner))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 89 * hash + (this.locationName != null ? this.locationName.hashCode() : 0);
        hash = 89 * hash + (this.address != null ? this.address.hashCode() : 0);
        hash = 89 * hash + (this.owner != null ? this.owner.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "Location{" + "id=" + id + "locationName=" + locationName + "address=" + address + "owner=" + owner + '}';
    }
}
